#include<func.h>
//使用siganl忽略2号信号,通过sigpending检测是否有信号挂起
int main()
{
    signal(SIGINT,SIG_IGN);//忽略2号信号
    sleep(5);
    sigset_t pending;
    sigemptyset(&pending);
    sigpending(&pending);//拿出内核正在挂起的信号
    if(sigismember(&pending,SIGINT))//通过sigpending检测是否有2号信号挂起
    {
        printf("SIGINT is pending\n");
    }
    else{
        printf("SIGINT is not pending\n");
    }
    printf("you can see me\n");
    return 0;
}